From: C. Scott Ananian Date: Wed, 25 Jan 2017 17:50:52 +0000 (-0500) Subject: Sync up with Parsoid parserTests. X-Git-Tag: 1.31.0-rc.0~4231^2 X-Git-Url: http://git.cyclocoop.org/%27%20.%20%24prefix%20.%20Wiki::transformTitleToURI%28%24matches%5B1%5D%29%20.%20%27?a=commitdiff_plain;h=121962101f692e1651714bb8de0cfc6ca78a636e;p=lhc%2Fweb%2Fwiklou.git Sync up with Parsoid parserTests. This now aligns with Parsoid commit 643d5392bcf4dfebf906102627c51e8a608125bf Change-Id: I4d7dc7378ca7cfdb3919f33959f58eb5c4d88ca8 --- diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index ed09203434..983c1723e0 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -933,6 +933,7 @@ Italics and bold: 5-quote opening sequence: (5,6) ### ### multiple quote sequences in a line ### + !! test Italics and bold: multiple quote sequences: (2,4,2) !! options @@ -942,8 +943,7 @@ parsoid=wt2html !! html/*

foo'bar

-!!end - +!! end # same html as previous, but wikitext adjusted to match parsoid html2wt !! test @@ -955,7 +955,6 @@ Italics and bold: multiple quote sequences: (2,4,2+3) w/ nowiki

!! end - !! test Italics and bold: multiple quote sequences: (2,4,3) !! options @@ -965,8 +964,7 @@ parsoid=wt2html !! html/*

foo'bar

-!!end - +!! end # same html as previous, but wikitext adjusted to match parsoid html2wt !! test @@ -978,7 +976,6 @@ Italics and bold: multiple quote sequences: (2,4,3+2) w/ nowiki

!! end - !! test Italics and bold: multiple quote sequences: (2,4,4) !! options @@ -988,8 +985,7 @@ parsoid=wt2html !! html/*

foo'bar'

-!!end - +!! end # same html as previous, but wikitext adjusted to match parsoid html2wt !! test @@ -1001,7 +997,6 @@ Italics and bold: multiple quote sequences: (2,4,4+2) w/ nowiki

!! end - # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test Italics and bold: multiple quote sequences: (3,4,2) @@ -1015,24 +1010,21 @@ parsoid=wt2html !! html/parsoid

foo'bar

-!!end +!! end # same html as previous, but wikitext adjusted to match parsoid html2wt !! test Italics and bold: multiple quote sequences: (3,4,2+2) w/ nowiki -!! options -parsoid !! wikitext -'''foo''''bar'''' +'''foo''''bar'''' !! html/php

foo'bar

!! html/parsoid -

foo'bar +

foo'bar

!! end - # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test Italics and bold: multiple quote sequences: (3,4,3) @@ -1046,18 +1038,18 @@ parsoid=wt2html !! html/parsoid

foo'bar

-!!end +!! end # same html as previous, but wikitext adjusted to match parsoid html2wt !! test Italics and bold: multiple quote sequences: (3,4,3+3) w/ nowiki !! wikitext -'''foo''''bar'''''' +'''foo''''bar'''''' !! html/php

foo'bar

!! html/parsoid -

foo'bar +

foo'bar

!! end @@ -1135,7 +1127,7 @@ The ''[[Main Page]]'''s talk page.

The Main Page's talk page.

!! html/parsoid -

The Main Page's talk page.

+

The Main Page's talk page.

!! end !! test @@ -2861,9 +2853,9 @@ Parsoid: pipe in transclusion parameter !! html/php+tidy

http://foo.com/a%7Cb

!! html/parsoid -

http://foo.com/a|b

+data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"http://foo.com/a|b"}},"i":0}}]}'>http://foo.com/a%7Cb

!! end !! test @@ -4798,6 +4790,17 @@ news:'a'b''c''d e

news:'a'bcd e

!! end +!! test +External links: with entity +!! wikitext +[http:// www.librarieswithoutborders.org Libraries without borders] +!! html/php +

Libraries without borders +

+!! html/parsoid +

Libraries without borders

+!! end + !! test External links: Lone protocols are never linked (T105697) !! wikitext @@ -5460,7 +5463,7 @@ http://example.com/index.php?foozoid[]=bar !! html/parsoid

http://example.com/index.php?foozoid%5B%5D=bar

-

http://example.com/index.php?foozoid[]=bar

+

http://example.com/index.php?foozoid%5B%5D=bar

!! end !! test @@ -6407,7 +6410,7 @@ parsoid=wt2html,html2html !! html/parsoid -
" onmouseover="alert(document.cookie)">test
+[ftp://%7Cx]" onmouseover="alert(document.cookie)">test !! end !! test @@ -7485,7 +7488,7 @@ Piped link with multiple pipe characters in link text

|The|Main|Page|

!! html/parsoid -

|The|Main|Page|

+

|The|Main|Page|

!! end !! test @@ -7841,6 +7844,17 @@ Link containing double-single-quotes '' (bug 4598)

Lista d''e paise d''o munno

!! end +!! test +Link containing double quotes and spaces +!! wikitext +[[Cool "Gator"]] +!! html/php +

Cool "Gator" +

+!! html/parsoid +

Cool "Gator"

+!! end + !! test Link containing double-single-quotes '' in text (bug 4598 sanity check) !! wikitext @@ -7849,7 +7863,7 @@ Some [[Link|pretty ''italics'' and stuff]]!

Some pretty italics and stuff!

!! html/parsoid -

Some pretty italics and stuff!

+

Some pretty italics and stuff!

!! end !! test @@ -7879,9 +7893,9 @@ Link with double quotes in title part (literal) and alternate part (interpreted)

!! html/parsoid

-

''Pentecoste''

-

Pentecoste

-

Pentecoste

+

''Pentecoste''

+

Pentecoste

+

Pentecoste

!! end !! test @@ -7976,7 +7990,7 @@ Piped link to URL: [[http://www.example.com|an example URL]]

Piped link to URL: [example URL]

!! html/parsoid -

Piped link to URL: [example URL]

+

Piped link to URL: [example URL]

!! end !! test @@ -8180,12 +8194,10 @@ title=[[User:test/123]] !! test 1. Interaction of linktrail and template encapsulation -!! options -parsoid !! wikitext {{echo|[[Foo]]}}l -!! html -

Fool

+!! html/parsoid +

Fool

!! end !! test @@ -8255,7 +8267,7 @@ Parsoid link trail escaping !! options parsoid=html2wt,html2html !! html/parsoid -

apples

+

apples

!! wikitext [[apple]]s !! end @@ -8266,7 +8278,7 @@ Parsoid link prefix escaping language=is parsoid=html2wt,html2html !! html/parsoid -

Aðrir mótmælendasöfnuður

+

Aðrir mótmælendasöfnuður

!! wikitext Aðrir mótmælenda[[söfnuður]] !! end @@ -8291,12 +8303,10 @@ Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved !! test Parsoid: Scoped parsing should handle mixed transclusions and plain text -!! options -parsoid !! wikitext [[Foo|{{echo|a}} b {{echo|c}}]] -!! html -

a b c

+!! html/parsoid +

a b c

!! end !! test @@ -8711,8 +8721,8 @@ Parsoid bug 53221: Wikilinks should be properly entity-escaped !! options parsoid={ "modes": ["html2wt"], "suppressErrors": true } !! html/parsoid -

He llo He llo

-

He llo He llo

+

He llo He llo

+

He llo He llo

!! wikitext He llo [[Foo|He llo]] @@ -10361,7 +10371,7 @@ Parsoid: Page property magic word with magic word contents !! wikitext {{DISPLAYTITLE:''{{PAGENAME}}''}} !! html/parsoid - + !! end !! test @@ -13577,7 +13587,7 @@ Image with link parameter, wiki target

Foobar.jpg

!! html/parsoid -

+

!! end # parsoid bug 49293 (part 1) @@ -13684,7 +13694,7 @@ Image with link parameter (wiki target) and unnamed parameter

Title

!! html/parsoid -

+

!! end !! test @@ -13736,7 +13746,7 @@ parsoid=wt2html,wt2wt,html2html
Title
!! html/parsoid -
Title
+
Title
!! end !! test @@ -13778,7 +13788,7 @@ parsoid=wt2html,wt2wt,html2html
alttext
Title
!! html/parsoid -
alttext
Title
+
alttext
Title
!! end !! test @@ -13791,7 +13801,7 @@ parsoid=wt2html,wt2wt,html2html
This is a test image Main Page
!! html/parsoid -
This is a test image Main Page
+
This is a test image Main Page
!! end !! test @@ -13804,7 +13814,7 @@ parsoid=wt2html,wt2wt,html2html
Altitude
This is a test image Main Page
!! html/parsoid -
Altitude
This is a test image Main Page
+
Altitude
This is a test image Main Page
!! end !! test @@ -14268,7 +14278,7 @@ parsoid=wt2html,wt2wt,html2html

[[Image:Foobar.jpg|thumb|This is a broken caption. But this is just an ordinary link.

!! html/parsoid -

[[Image:Foobar.jpg|thumb|This is a broken caption. But this is just an ordinary link.

+

[[Image:Foobar.jpg|thumb|This is a broken caption. But this is just an ordinary link.

!! end !! test @@ -14381,7 +14391,7 @@ language=es
caption
!! html/parsoid -
caption
+
caption
!! end !! test @@ -14755,8 +14765,8 @@ subpage title=[[Subpage test/1/2/3/4]]

Subpage test/1/2/subpage

!! html/parsoid -

subpage

-

Subpage_test/1/2/subpage

+

subpage

+

Subpage_test/1/2/subpage

!! end !! test @@ -15046,12 +15056,12 @@ Bar Bar

!! html/parsoid -

Foo Bar

-

Foo Bar

-

Foo Bar

-

Foo Bar

-

Foo Bar

- +

Foo Bar

+

Foo Bar

+

Foo Bar

+

Foo Bar

+

Foo Bar

+ !! end ## We used to, but no longer wt2wt this test since the default serializer @@ -16523,9 +16533,11 @@ Template:Div style Bug 2304: HTML attribute safety (safe template; regression bug 2309) !! wikitext
-!! html +!! html/php
+!! html/parsoid +
!! end # Parsoid has enough context to handle this case @@ -16544,29 +16556,36 @@ Bug 2304: HTML attribute safety (dangerous template; 2309) Bug 2304: HTML attribute safety (dangerous style template; 2309) !! wikitext
-!! html +!! html/php
+!! html/parsoid +
!! end !! test Bug 2304: HTML attribute safety (safe parameter; 2309) !! wikitext {{div style|width: 200px}} -!! html +!! html/php
Magic div
+!! html/parsoid +
Magic div
!! end !! test Bug 2304: HTML attribute safety (unsafe parameter; 2309) !! wikitext {{div style|width: expression(alert(document.cookie))}} -!! html +!! html/php
Magic div
+!! html/parsoid +
Magic div
!! end +## Parsoid output here differs; needs investigation. !! test Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309) !! wikitext @@ -16576,6 +16595,7 @@ Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309) !! end +## Parsoid output here differs; needs investigation. !! test Bug 2304: HTML attribute safety (unsafe breakout parameter 2; 2309) !! wikitext @@ -16612,7 +16632,6 @@ Bug 2304: HTML attribute safety (bold) !! end - !! test Bug 2304: HTML attribute safety (ISBN) !! wikitext @@ -16662,18 +16681,22 @@ Bug 2304: HTML attribute safety (named web link) Bug 3244: HTML attribute safety (extension; safe) !! wikitext
-!! html +!! html/php
+!! html/parsoid +
!! end !! test Bug 3244: HTML attribute safety (extension; unsafe) !! wikitext
-!! html +!! html/php
+!! html/parsoid +
!! end # More MSIE fun discovered by Tom Gilder @@ -16682,45 +16705,55 @@ Bug 3244: HTML attribute safety (extension; unsafe) MSIE CSS safety test: spurious slash !! wikitext
evil
-!! html +!! html/php
evil
+!! html/parsoid +
evil
!! end !! test MSIE CSS safety test: hex code !! wikitext
evil
-!! html +!! html/php
evil
+!! html/parsoid +
evil
!! end !! test MSIE CSS safety test: comment in url !! wikitext
evil
-!! html +!! html/php
evil
+!! html/parsoid +
evil
!! end !! test MSIE CSS safety test: comment in expression !! wikitext
evil4
-!! html +!! html/php
evil4
+!! html/parsoid +
evil4
!! end !! test CSS safety test (all browsers): vertical tab (bug 55332 / CVE-2013-4567) !! wikitext

A

-!! html +!! html/php

A

+!! html/parsoid +

A

!! end !! test @@ -16728,10 +16761,13 @@ MSIE 6 CSS safety test: Fullwidth (bug 55332) !! wikitext

A

B
-!! html +!! html/php

A

B
+!! html/parsoid +

A

+
B
!! end !! test @@ -16739,10 +16775,13 @@ MSIE 6 CSS safety test: IPA extensions (bug 55332) !! wikitext
A

B

-!! html +!! html/php
A

B

+!! html/parsoid +
A
+

B

!! end !! test @@ -16751,23 +16790,30 @@ MSIE 6 CSS safety test: sup/sub script (bug 55332)
A
B

C

-!! html +!! html/php
A
B

C

+!! html/parsoid +
A
+
B
+

C

!! end -# FIXME: Parsoid fails to sanitize this! See T58846. !! test Opera -o-link CSS +!! options +parsoid=wt2html,html2html !! wikitext
X
-!! html +!! html/php
X
+!! html/parsoid +
X
!! end !! test @@ -16780,7 +16826,7 @@ MSIE 6 CSS safety test: Repetition markers (bug 55332)

E

F

G

-!! html +!! html/php

A

B

C

@@ -16789,6 +16835,14 @@ MSIE 6 CSS safety test: Repetition markers (bug 55332)

F

G

+!! html/parsoid +

A

+

B

+

C

+

D

+

E

+

F

+

G

!! end !! test @@ -16852,7 +16906,6 @@ Expansion of multi-line templates in attribute values (bug 6255) !! end - !! test Expansion of multi-line templates in attribute values (bug 6255 sanity check) !! wikitext @@ -16886,6 +16939,7 @@ Tags which are hidden from Tidy cannot pass through the Sanitizer ### ### Parser hooks (see tests/parser/parserTestsParserHook.php for the extension) ### + !! test Parser hook: empty input !! wikitext @@ -18856,7 +18910,6 @@ stuff xxx !! end - !! test Handling of in URLs !! wikitext @@ -18865,9 +18918,7 @@ Handling of in URLs !! html/parsoid - + !! end !! test @@ -18881,7 +18932,6 @@ Handling of %0A in URLs !! end - # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test 5 quotes, code coverage +1 line @@ -19452,6 +19502,27 @@ File:Foobar.jpg|alt=galleryalt|link=http://www.example.org !! end +!! test +Gallery override link with absolute external link with LanguageConverter +!! options +language=zh +!! input + +File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org + +!! result + + +!! end + !! test Gallery override link with malicious javascript (T36852) !! options @@ -19474,7 +19545,7 @@ File:Foobar.jpg|alt=galleryalt|link=" onclick="alert('malicious javascript code! !! html/parsoid !! end @@ -19504,6 +19575,24 @@ File:Foobar.jpg|link=< !! end +!! test +Serialize gallery without attrs in data-mw +!! options +parsoid={ + "modes": ["html2wt"], + "nativeGallery": true +} +!! html/parsoid + +!! wikitext + +File:Test.png + +!! end + !! test HTML Hex character encoding (spells the word "JavaScript") !! options @@ -19787,7 +19876,6 @@ dt/dd/dl test !!end - # Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "" tag. !! test Images with the "|" character in the comment @@ -19797,7 +19885,7 @@ Images with the "|" character in the comment
An external URL
!! html/parsoid -
An external URL
+
An external URL
!! end !! test @@ -20349,8 +20437,8 @@ parsoid=wt2html !! html/php cat=分类 sort= !! html/parsoid -

A

- +

A

+ !! end !! test @@ -22384,82 +22472,6 @@ File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink !! end -!!test -Gallery override link with absolute external link (bug 34852) -!! wikitext - -File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org - -!! html - - -!! end - -!! test -Gallery override link with absolute external link with LanguageConverter -!! options -language=zh -!! input - -File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org - -!! result - - -!! end - -!!test -Gallery override link with malicious javascript (bug 34852) -!! wikitext - -File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascript code!'); - -!! html - - -!! end - -!!test -Gallery with invalid title as link (bug 43964) -!! wikitext - -File:foobar.jpg|link=< - -!! html - - -!! end - !!test Language parser function !! wikitext @@ -22721,7 +22733,7 @@ A

A [1]

    -
  1. ↑ This is a bolded link and this is a transclusion +
  2. ↑ This is a bolded link and this is a transclusion
!!end